package matchthreegame.serverEvents;

import matchthreegame.extensions.MatchThreeGameZoneExtension;

import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.exceptions.SFSException;
import com.smartfoxserver.v2.exceptions.SFSLoginException;
import com.smartfoxserver.v2.extensions.BaseServerEventHandler;

public class OnServerReadyHandler extends BaseServerEventHandler {

	@Override
	public void handleServerEvent(ISFSEvent arg0) throws SFSException {
		
		// Create and Login NPC users to WaitingList
		for (int i = 1; i <= 0; i++) {
			String userName = "User" + i;
			try {
				User npcUser = getApi().createNPC(userName, getParentExtension().getParentZone(), true);
				((MatchThreeGameZoneExtension)getParentExtension().getParentZone().getExtension()).joinUserToLobby(npcUser);
			} catch (SFSLoginException e) {
				
				e.printStackTrace();
			}

		}

	}

}
